/**
 *created by renwei on 2019/9/9
 */

import XLSX from 'xlsx';

//导出excel
function exportExcel(data, fileName) {
  const ws = XLSX.utils.json_to_sheet(data);
  const wb = XLSX.utils.book_new();
  XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');

  // 导出 Excel
  XLSX.writeFile(wb, fileName);
}

export default exportExcel;
